package com.ruoyi.jypc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jypc.mapper.CarorderMapper;
import com.ruoyi.jypc.domain.Carorder;
import com.ruoyi.jypc.service.ICarorderService;

/**
 * 用车订单Service业务层处理
 * 
 * @author HWJ
 * @date 2022-11-02
 */
@Service
public class CarorderServiceImpl implements ICarorderService 
{
    @Autowired
    private CarorderMapper carorderMapper;

    /**
     * 查询用车订单
     * 
     * @param orderid 用车订单主键
     * @return 用车订单
     */
    @Override
    public Carorder selectCarorderByOrderid(Long orderid)
    {
        return carorderMapper.selectCarorderByOrderid(orderid);
    }
    
    /**
     * 查询用车订单列表
     * 
     * @param carorder 用车订单
     * @return 用车订单集合
     */
	/*
	 * @Override public List<Carorder> selectCarorderListpointAll(){ return
	 * carorderMapper.selectCarorderListpointAll(); }
	 */

    /**
     * 查询用车订单列表
     * 
     * @param carorder 用车订单
     * @return 用车订单
     */
    @Override
    public List<Carorder> selectCarorderList(Carorder carorder)
    {
        return carorderMapper.selectCarorderList(carorder);
    }
    
    /**
     * 查询用车订单列表
     * 
     * @param carorder 用车订单
     * @return 用车订单集合
     */
    @Override
    public List<Carorder> selectCarorderListAll(){
    	return carorderMapper.selectCarorderListAll();
    }

    /**
     * 新增用车订单
     * 
     * @param carorder 用车订单
     * @return 结果
     */
    @Override
    public int insertCarorder(Carorder carorder)
    {
        carorder.setCreateTime(DateUtils.getNowDate());
        return carorderMapper.insertCarorder(carorder);
    }

    /**
     * 修改用车订单
     * 
     * @param carorder 用车订单
     * @return 结果
     */
    @Override
    public int updateCarorder(Carorder carorder)
    {
        carorder.setUpdateTime(DateUtils.getNowDate());
        return carorderMapper.updateCarorder(carorder);
    }

    /**
     * 批量删除用车订单
     * 
     * @param orderids 需要删除的用车订单主键
     * @return 结果
     */
    @Override
    public int deleteCarorderByOrderids(Long[] orderids)
    {
        return carorderMapper.deleteCarorderByOrderids(orderids);
    }

    /**
     * 删除用车订单信息
     * 
     * @param orderid 用车订单主键
     * @return 结果
     */
    @Override
    public int deleteCarorderByOrderid(Long orderid)
    {
        return carorderMapper.deleteCarorderByOrderid(orderid);
    }
}
